import request from '@/api/http.js'

// 获取仓库数据
export const getWareHouse = () => {
  return request.post('api/Warehouse/getPageData', {
    page: 1,
    rows: 10000,
    sort: 'CreateDate',
    order: 'desc',
    wheres: JSON.stringify([])
  })
}

//获取存货数据
export const getInventory = (params) => {
  return request.post('api/Inventory/getPageData', params)
}

//获取产品检验单列表
export const getProductInspectionOrderList = (params) => {
    console.log('changeWorkStatus发送参数:', params)
    const query = new URLSearchParams(params).toString();
    return request.get(`api/ProductInspectionOrder/GetProductInspectionOrderList?${query}`)
}

// 获取产品入库单详情
export const getProductReceiveOrderInfo = (id) => {
    return request.get(`api/ProductReceiveOrder/GetProductReceiveOrderInfo?id=${id}`)
}

//获取产成品入库单列表
export const getProductWarehouseReceiptList = (params) => {
    console.log('changeWorkStatus发送参数:', params)
    const query = new URLSearchParams(params).toString();
    return request.get(`api/ProductReceiveOrder/GetProductInspectionOrderList?${query}`)
}

// 新增产成品入库单
export const addProductReceiveOrderOrder = (params) => {
    return request.post('api/ProductReceiveOrder/AddProductReceiveOrderOrder',params)
}

// 编辑产成品入库单
export const updateProductReceiveOrderOrder = (params) => {
    return request.post('api/ProductReceiveOrder/UpdateProductReceiveOrderOrder',params)
}

// 修改产成品入库单状态
export const updateProductInspectionOrderStatus = (params) => {
    return request.post(`api/ProductReceiveOrder/UpdateProductReceiveOrderStatus`,params)
}